//package src;

import java.awt.*;
import java.awt.geom.*;
import java.io.*;

public class ShapeFree extends Shape
{	

  	GraphicsObject object1 = new GraphicsObject();
    Point2D.Double point1 = new Point2D.Double();
    
    private int currentX, currentY, oldX, oldY, width, height;

	public ShapeFree(int x1, int y1, int x2, int y2, Color color)
  	{
  		super(color);				
  		currentX = x1;
  		currentY = y1;
  		oldX = x2;
  		oldY = y2;
  		
  		
  	}

  	public void draw(Graphics g)
  	{								
		Graphics2D g2d = (Graphics2D) g;
		g2d.setColor(getColor());
        g2d.drawLine(oldX, oldY, currentX, currentY);
        point1.setLocation((double)currentX, (double)currentY);	
        object1.addPoint(point1);
  	}

	
	public int setLeftPoint(int x)	
	{
		return 0;
	}
	
	public int setTopPoint(int y)	
	{
		return 0;
	}
	

}

